package com.example.demo.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.dao.inteface.UserEntityService;
import com.example.demo.dao.inteface.impl.UserEntityServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yang
 */
@RestController
public class PageController {

    @Autowired
    private UserEntityService userEntityService;

    @GetMapping("/get")
    @ResponseBody
    public String getPage(){
        Page page = new Page(1,2);
        Integer state = 1;
        IPage iPage = userEntityService.selectUserPage(page, state);
        return iPage.toString();
    }
}
